package com.candy.util;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author donglin
 * @Title:
 * @类名: TestOfDBHelper
 * @date 2021/1/6
 */
public class TestOfDBHelper {
    public static void main(String[] args) {
    test03();
    }

    public static void test03() {
        int i=DBHelper.update("INSERT into studentinfo (userId,userName,userPwd,userAddress,useTel) VALUES(9,'雪狐','123','北极','16589742654');");
        System.out.println(i);
    }
    public static void test02() {
        List<Map<String,Object>> list=DBHelper.query4ListMap("select * from studentinfo");
        for (Map<String,Object> mapEachRow:list
             ) {
          Set<Map.Entry<String,Object>> en= mapEachRow.entrySet();
            for (Map.Entry<String,Object> e:en
                 ) {
                System.out.print("  "+e.getValue());
            }
            System.out.println();


        }





    }
    public static void test01() {
        try {
            ResultSet rs=DBHelper.query("select * from studentinfo");
            while(rs.next()){
                System.out.print(" "+rs.getObject(1));
                System.out.print(" "+rs.getObject(2));
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }


    }
}
